#include "../server.hpp"

#include <stdio.h>

int main(void)
{
    Socket client;
    client.CreateClient(8500, "127.0.0.1");
    // while (true)
    for (int i = 0; i < 5; i++)
    {
        // client 先发送给 server 要处理的任务
        std::string str = "nihao";
        client.Send(str.c_str(), sizeof(str));
        // client 再接收 server 的处理返回的结果
        char buffer[1024] = {0};
        client.Recv(buffer, sizeof(buffer) - 1);
        DBG_LOG("%s", buffer);

        sleep(1);
    }
    while (true)
        sleep(1);
    client.Close();

    return 0;
}